import { defineStore } from 'pinia'
import { ref } from 'vue'

export const PageStore = defineStore(
  'page',
  () => {
    const current = ref(1)
    const setCurrent = (newvalue) => {
        current.value = newvalue
    }
    const page = ref(20)
    const setPage = (newvalue) => {
        page.value = newvalue
    }
    const total = ref(100)
    const setTotal = (newvalue) => {
        total.value = newvalue
    }
    return {
        current,
        setCurrent,
        page,
        setPage,
        total,
        setTotal,
    }
  },
  {
    persist: true
  }
)
